﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using fetco.entities;
using fetco.data;

namespace fetco.service
{
    public class WebPortalService
    {
        public static WebPortal GetWebPortal(int webportal_id)
        {
            WebPortalDAO webportal_dao = WebPortalDAO.GetInstance();
            return webportal_dao.GetWebPortalById(webportal_id);
        }

        public static ListWebPortal GetListWebPortal()
        {
            WebPortalDAO webportal_dao = WebPortalDAO.GetInstance();
            return webportal_dao.GetListWebPortal(OrderByDirection.ASC);
        }

        public static bool AddWebPortal(WebPortal webportal)
        {
            webportal.WebStatus = 1;
            WebPortalDAO webportal_dao = WebPortalDAO.GetInstance();
            webportal_dao.SetWebPortal(webportal);
            if (webportal.WebId != 0)
                return true;
            return false;
        }

        public static bool UpdateWebPortal(WebPortal webportal)
        {
            WebPortalDAO webportal_dao = WebPortalDAO.GetInstance();
            return webportal_dao.UpdateWebPortal(webportal);
        }

        public static bool RemoveWebPortal(int webportal_id)
        {
            WebPortalDAO webportal_dao = WebPortalDAO.GetInstance();
            return webportal_dao.DelWebPortal(webportal_id);
        }
    }
}
